Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Conversation

@kozlov-alexey
Copy link
Contributor

Motivation: removing types.None as representation of default pd.RangeIndex
created when index=None is used in DF and Series ctors, that requires
most of Series and DF implementations to branch basing on index types.
Instead all Series and DF functions should use common indexes API
aligned to pandas one.

Changed in this PR:

  • types.None index is removed;
  • Added EmptyIndexType (instead types.None index) to represent empty
    pandas index with dtype='Object' i.e. pd.Index([]);
  • Added PositionalIndexType as a replacement for types.None index for
    non-empty DFs and Series;
  • Changed unboxing of RangeIndex objects to either RangeIndexType of
    PositionalIndexType depending on whether it's default range or not;
  • Changed fix_df_index and dataframe_constructor.py to create
    EmptyIndexType or other index depending on whether tuple of columns is empty;
  • Moved implementations for index types from common and
    numpy_like functions to specific index files;
  • Updated operators and other Series methods implementations to avoid
    branching on index types and used index objects API instead;
  • Reorganized index tests and added tests verifying specific function
    (e.g. series reindexing) for all types of indexes.

kozlov-alexey and others added 2 commits December 31, 2020 19:57
Motivation: removing types.None as representation of default pd.RangeIndex
created when index=None is used in DF and Series ctors, that requires
most of Series and DF implementations to branch basing on index types.
Instead all Series and DF functions should use common indexes API
aligned to pandas one.

Changed in this PR:
- types.None index is removed;
- Added EmptyIndexType (instead types.None index) to represent empty
pandas index with dtype='Object' i.e. pd.Index([]);
- Added PositionalIndexType as a replacement for types.None index for
non-empty DFs and Series;
- Changed unboxing of RangeIndex objects to either RangeIndexType of
PositionalIndexType depending on whether it's default range or not;
- Changed fix_df_index and dataframe_constructor.py to create
EmptyIndexType or other index depending on whether tuple of columns is empty;
- Moved implementations for index types from common and
numpy_like functions to specific index files;
- Updated operators and other Series methods implementations to avoid
branching on index types and used index objects API instead;
- Reorganized index tests and added tests verifying specific function
(e.g. series reindexing) for all types of indexes.
@kozlov-alexey kozlov-alexey force-pushed the feature/add_more_index_types branch from 8dc72a5 to 013b180 Compare January 19, 2021 14:00
@pep8speaks
Copy link

pep8speaks commented Jan 19, 2021

Hello @kozlov-alexey! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-02-01 21:33:47 UTC

@kozlov-alexey kozlov-alexey force-pushed the feature/add_more_index_types branch from 2b9c725 to c09be09 Compare February 1, 2021 19:27
@kozlov-alexey kozlov-alexey force-pushed the feature/add_more_index_types branch from 6137f3e to 098d26e Compare April 2, 2021 14:35
@kozlov-alexey
Copy link
Contributor Author

@AlexanderKalistratov Can you please approve so we can finally merge this?

@kozlov-alexey kozlov-alexey merged commit abc9fbb into IntelPython:master Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants